home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Sessions / Completions / Completions Source / Files / FileOpener.h < prev    next >
Encoding:
Text File  |  1998-06-15  |  948 b   |  47 lines  |  [TEXT/CWIE]

  1. // FileOpener.h
  2.  
  3. #ifndef FileOpener_h
  4. #define FileOpener_h
  5.  
  6. #ifndef HParamBlockTask_h
  7. #include "HParamBlockTask.h"
  8. #endif
  9.  
  10. class FileReadingPath;
  11. class FileWritingPath;
  12.  
  13. class FileOpener: private HParamBlockTask
  14.   {
  15.     private:
  16.         FileReadingPath *path;
  17.         bool dataFork;
  18.         
  19.         void BuildParamBlock( const FSSpec&, SignedByte );
  20.         
  21.         virtual void Launch();
  22.         virtual void Kill();
  23.         
  24.         virtual void AtCompletion();
  25.         
  26.     public:
  27.         Task *OpenDataFork( const FSSpec&,
  28.                                   FileReadingPath&,
  29.                                   SignedByte permission = fsRdPerm );
  30.  
  31.         Task *OpenDataFork( const FSSpec&,
  32.                                   FileWritingPath&,
  33.                                   SignedByte permission = fsWrPerm );
  34.         
  35.         Task *OpenResourceFork( const FSSpec&,
  36.                                         FileReadingPath&,
  37.                                         SignedByte permission = fsRdPerm );
  38.         
  39.         Task *OpenResourceFork( const FSSpec&,
  40.                                         FileWritingPath&,
  41.                                         SignedByte permission = fsWrPerm );
  42.         
  43.         OSErr Error() const        { return ioParam.ioResult; }
  44.   };
  45.  
  46. #endif
  47.